﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace blackhouse.Web.FasterFiles
{
    internal class FasterFilesStore : List<FasterFilesStoreItem>
    {

        private DateTime setDate = DateTime.Now;

        public void AddFile(FasterFilesType type, Type senderType, string file)
        {
            FasterFilesStoreItem item = new FasterFilesStoreItem();
            item.File = file;
            item.SenderType = senderType;
            item.Type = type;
            if (!Contains(item))
                this.Add(item);
        }

        public bool IsExpired(TimeSpan interval)
        {
            return setDate + interval < DateTime.Now;
        }

    }
}